package com.zg.datapush.constant;

/**
 * 数据推送常量类
 * @author zg
 */
public class DataPushConstants {

    // ==================== 推送模式 ====================
    /** 全量推送 */
    public static final String PUSH_MODE_FULL = "full";
    /** 增量推送 */
    public static final String PUSH_MODE_INCREMENT = "increment";

    // ==================== 目标类型 ====================
    /** 数据库推送 */
    public static final String TARGET_TYPE_DATABASE = "database";
    /** REST接口推送 */
    public static final String TARGET_TYPE_REST = "rest";

    // ==================== 调度类型 ====================
    /** 手动调度 */
    public static final String SCHEDULE_TYPE_MANUAL = "manual";
    /** Cron表达式调度 */
    public static final String SCHEDULE_TYPE_CRON = "cron";

    // ==================== 任务状态 ====================
    /** 任务禁用 */
    public static final Integer TASK_STATUS_DISABLED = 0;
    /** 任务启用 */
    public static final Integer TASK_STATUS_ENABLED = 1;

    // ==================== 推送记录状态 ====================
    /** 推送运行中 */
    public static final String RECORD_STATUS_RUNNING = "running";
    /** 推送成功 */
    public static final String RECORD_STATUS_SUCCESS = "success";
    /** 推送失败 */
    public static final String RECORD_STATUS_FAILED = "failed";
    /** 部分成功 */
    public static final String RECORD_STATUS_PARTIAL = "partial";

    // ==================== 触发类型 ====================
    /** 手动触发 */
    public static final String TRIGGER_TYPE_MANUAL = "manual";
    /** 定时触发 */
    public static final String TRIGGER_TYPE_CRON = "cron";

    // ==================== 接口推送类型 ====================
    /** 默认推送 */
    public static final String PUSH_TYPE_DEFAULT = "default";
    /** 自定义推送 */
    public static final String PUSH_TYPE_CUSTOM = "custom";

    // ==================== 数据转换表达式 ====================
    /** 转换为字符串 */
    public static final String CONVERT_TO_STRING = "toString";
    /** 转换为整数 */
    public static final String CONVERT_TO_INT = "toInt";
    /** 转换为长整数 */
    public static final String CONVERT_TO_LONG = "toLong";
    /** 转换为双精度浮点数 */
    public static final String CONVERT_TO_DOUBLE = "toDouble";
    /** 转换为单精度浮点数 */
    public static final String CONVERT_TO_FLOAT = "toFloat";
    /** 转换为布尔值 */
    public static final String CONVERT_TO_BOOLEAN = "toBoolean";
    /** 转换为大写 */
    public static final String CONVERT_TO_UPPER_CASE = "toUpperCase";
    /** 转换为小写 */
    public static final String CONVERT_TO_LOWER_CASE = "toLowerCase";
    /** 去除空格 */
    public static final String CONVERT_TRIM = "trim";
    /** 当前时间戳 */
    public static final String CONVERT_CURRENT_TIMESTAMP = "currentTimestamp";
    /** 当前日期 */
    public static final String CONVERT_CURRENT_DATE = "currentDate";

    // ==================== 转换表达式前缀 ====================
    /** 字符串连接前缀 */
    public static final String CONVERT_PREFIX_CONCAT = "concat:";
    /** 字符串前缀添加 */
    public static final String CONVERT_PREFIX_PREFIX = "prefix:";
    /** 字符串截取 */
    public static final String CONVERT_PREFIX_SUBSTRING = "substring:";
    /** 字符串替换 */
    public static final String CONVERT_PREFIX_REPLACE = "replace:";
    /** 数值加法 */
    public static final String CONVERT_PREFIX_ADD = "add:";
    /** 数值乘法 */
    public static final String CONVERT_PREFIX_MULTIPLY = "multiply:";
    /** 日期格式化 */
    public static final String CONVERT_PREFIX_DATE_FORMAT = "dateFormat:";
    /** 当前日期格式化 */
    public static final String CONVERT_PREFIX_CURRENT_DATE_FORMAT = "currentDateFormat:";

    // ==================== 媒体类型 ====================
    /** JSON媒体类型 */
    public static final String MEDIA_TYPE_JSON = "application/json";
    /** XML媒体类型 */
    public static final String MEDIA_TYPE_XML = "application/xml";
    /** 表单媒体类型 */
    public static final String MEDIA_TYPE_FORM = "application/x-www-form-urlencoded";

    // ==================== 分布式锁Key ====================
    /** 任务扫描锁前缀 */
    public static final String LOCK_KEY_SCHEDULE_SCAN = "datapush:schedule:scan";
    /** 任务执行锁前缀 */
    public static final String LOCK_KEY_TASK_PREFIX = "datapush:task:";

    // ==================== 状态值常量 ====================
    /** 成功状态 */
    public static final String STATUS_SUCCESS = "成功";
    /** 失败状态 */
    public static final String STATUS_FAILED = "失败";
    /** 部分成功状态 */
    public static final String STATUS_PARTIAL = "partial";

    // ==================== 私有构造函数 ====================
    private DataPushConstants() {
        // 防止实例化
    }
}
